class Test():
    def __len__(self):#不重载求长度时会报错
        return 89
    def __bool__(self): #默认为True
        return False

test = Test()
print(len(test))
print(bool(test))